# tup1 = ('NN', 221, (1, 2), [1, 2])
# print(type(tup1))

# 元组里面只有一个元素时，定义元组的时候，必须加一个”,“，否则，python会自动将唯一的一个元素赋值给变量
# tup2 = ("1",)
# print(type(tup2))


# # 通过下标，获取元素中的值
# tup1 = ('NN', 221, 246)
# # print(tup1[1])
# print(tup1[0][0])

# 切片,和字符串切片一样
# 变量是什么数据类型，切片返回的也是那个数据类型
# tup1 = ('NN', 221, 246, '坚果')
# # print(tup1[1:2])
# print(tup1[::2])

# tup1=('NN',221,246)
# tup3=('MS246',)
# new=tup1[0:2]+tup3
# # print(new)
# new2 = new*2
# print(new2)


# 常用方法
tup = (5, 31, 7, 34, 74, 3, 3, 3, 24, 56, 36, 86, 35, 77)
# print(tup.count(3))	# 统计指定元素有几个
# print(tup.index(3))	# 获取指定元素下标，只会获得第一个
# print(len(tup))
print(tup)
del tup
print(tup)